{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "# Before running this code, you will need to install a software package developed by Bessudnov et. al. from its Github repository:\n",
    "# https://github.com/abessudnov/ruEthnicNamesPublic\n",
    "\n",
    "# Import classifier and create object\n",
    "from ethnos_classifier import EthnosClassifier\n",
    "\n",
    "clf = EthnosClassifier()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Predict classes for the ruaf data table and save results to \"ruaf_pred.csv\"\n",
    "# This csv file is not included in the replication package since it contains de-anonymized data\n",
    "\n",
    "clf.predict('ruaf_data.csv', 'ruaf_pred.csv') "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Predict classes probabilities for \"ruaf.csv\" table and save results to \"ruaf_pr_pred.csv\"\n",
    "clf.predict('ruaf_data.csv', 'ruaf_pr_pred.csv', predict_probs=True)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
